package state_mode

func GetStateInstance(state int64) (*CaseState, error) {
	c := &CaseState{}
	switch state {
	case Start:
		c.State = NewStartCase()
	case Doing:
		c.State = NewDoingCase()
	case End:
		c.State = NewEndCase()
	default:
		return nil, newMyError(1, "工厂失败")
	}
	return c, nil
}
